/**
 * 
 */
package thread.tested;

/**
 * @author Administrator
 *
 */
public class SimpleThread extends Thread {
	
	public SimpleThread(String str) {
		super(str);
	}
	
	public void run() {
		for (int i = 0; i < 100; i++) {
			System.out.println(i + " " + getName());
			try {
					
				sleep((int)(Math.random() * 1000));
				
			} catch (InterruptedException e) 
			{
				e.printStackTrace();
			}
		}
		
		System.out.println("DONE! " + getName());
	}
	
	public static void main(String[] args) {
		
		try{
			
			new SimpleThread("SimpleThread").run();
			
		}catch(Exception e){
			e.printStackTrace();
		}
		
	} 
	
}